/*
 * @Author: your name
 * @Date: 2020-08-04 08:29:13
 * @LastEditTime: 2020-08-04 09:48:49
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \dcg-vue-init\src\utils\error-log.js
 */
import Vue from 'vue'

import store from '@/store'

console.log('引入 error-log')

Vue.config.errorHandler = function(err, vm, info) {
  console.log('error: ', err, vm, info)
  Vue.nextTick(() => {
    store.dispatch('error/addErr', {
      err: err.toString(),
      vm,
      info,
      url: window.location.href
    })
  })
}
